﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using MoetutuServer.Helper.PublishHelper;
using MoetutuServer.Pixiv;
using MoetutuServer.Pixiv.ProcessImg;
using MoetutuServer.WebSite.Pixiv;

namespace MoetutuServer.Helper
{
    class StaticValue
    {
        private static bool printFlag = true;
        private static string tempPath = ".\\TempPath\\";
        private static string ProcessImgPath = TempPath + "ProcessImg\\";
        private static string binPath = ".\\Bin\\";
        private static string userInfoPath = BinPath+"UserInfo\\";
        private static string printLogPath = TempPath + "Runlog.txt";


        //存放辅助识别标签的类
        private static string excludeKeyPath = BinPath + "ExcludeKeys.txt";
        private static string excludeRomeKeyPath = BinPath + "ExcludeRomeKeys.txt";
        private static String oldImgIdPath = BinPath + "OldImgId.txt";
        private static string romeTagPaht = BinPath + "RomaTag.txt";
        private static string safeTagPath = BinPath + "SafeTag.txt";
        private static string xmlPath= BinPath + "Tags.xml";
        private static List<String> excludeKey = TextHelper.ReadAllLine(excludeKeyPath);
        private static List<String> excludeRomeKey = TextHelper.ReadAllLine(RomeTagPath);
        private static List<string> OldImgID = TextHelper.ReadAllLine(OldImgIdPath);
        private static List<String> safeTagList = TextHelper.ReadAllLine(SafeTagPath);
        private static List<PixivHelper.TagStruct> tagStruct = WebSite.Pixiv.TagHelper.JpTagReadAll(XmlPath);
        private static List<string> jpTagList = WebSite.Pixiv.TagHelper.XMLReadJp(TagStruct);
        private static List<PublishHelper.TagHelper.RomeTagInfo> romeTagList = MoetutuServer.Helper.PublishHelper.TagHelper.ReadTagFile();
        private static string postUser = UserInfoPath + "LocalHost.dat";
        //到此结束
        //下载文件的辅助
        private static string ImgTemp = TempPath + "DownloadImg\\";
        private static string userAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";
        private static string moblieUserAgent = "Mozilla/5.0 (Linux; Android 7.0; PLUS Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36";
        //到此结束
        /// <summary>
        /// 基础header
        /// </summary>
        /// <param name="FileUrl"></param>
        /// <returns></returns>
        public static WebHeaderCollection CurrencyWebHeader()
        {
            WebHeaderCollection webHeaderCollection = new WebHeaderCollection();
            webHeaderCollection.Add("User-Agent", UserAgent);
            webHeaderCollection.Add("Accept-Language", "zh-TW,zh;q=0.8,en-US;q=0.5,en;q=0.3");
            return webHeaderCollection;
        }
        private static string tip = "当前无任务";
        private static string replaceFlag = "用于替换预览图的特定字符串";
        public static bool PrintFlag { get => printFlag; set => printFlag = value; }
        public static string TempPath { get => tempPath; set => tempPath = value; }
        public static string BinPath { get => binPath; set => binPath = value; }
        public static string PrintLogPath { get => printLogPath; set => printLogPath = value; }
        public static string UserAgent { get => userAgent; set => userAgent = value; }
        public static string MoblieUserAgent { get => moblieUserAgent; set => moblieUserAgent = value; }
        public static string Tip { get => tip; set => tip = value; }
       
        /// <summary>
        /// 屏蔽关键词list
        /// </summary>
        public static List<string> ExcludeKey { get => excludeKey; set => excludeKey = value; }
        /// <summary>
        /// 屏蔽关键词文件路径
        /// </summary>
        public static string ExcludeKeyPath { get => excludeKeyPath; set => excludeKeyPath = value; }
        /// <summary>
        /// 放置待人工处理文件的路径
        /// </summary>
        public static string ProcessImgPath1 { get => ProcessImgPath; set => ProcessImgPath = value; }
        /// <summary>
        /// 存放已下载过的图片ID的路径
        /// </summary>
        public static string OldImgIdPath { get => oldImgIdPath; set => oldImgIdPath = value; }
        /// <summary>
        /// 读取存放的旧的图片ID
        /// </summary>
        public static List<string> OldImgID1 { get => OldImgID; set => OldImgID = value; }
        /// <summary>
        /// 下载文件的临时存储路径
        /// </summary>
        public static string ImgTemp1 { get => ImgTemp; set => ImgTemp = value; }
        /// <summary>
        /// 用户信息存储路径
        /// </summary>
        public static string UserInfoPath { get => userInfoPath; set => userInfoPath = value; }
        /// <summary>
        /// 用于替换预览图的字符串
        /// </summary>
        public static string ReplaceFlag { get => replaceFlag; set => replaceFlag = value; }
     
        /// <summary>
        /// 较为通用的tag存放
        /// </summary>
        public static string SafeTagPath { get => safeTagPath; set => safeTagPath = value; }
        /// <summary>
        /// 较为安全的tag列表
        /// </summary>
        public static List<string> SafeTagList { get => safeTagList; set => safeTagList = value; }
        /// <summary>
        /// xml文件路径
        /// </summary>
        public static string XmlPath { get => xmlPath; set => xmlPath = value; }
        /// <summary>
        /// 日文标签路径
        /// </summary>
        public static List<string> JpTagList { get => jpTagList; set => jpTagList = value; }
        /// <summary>
        /// 当前用哪个用户发布文章
        /// </summary>
        public static string PostUser { get => postUser; set => postUser = value; }
        /// <summary>
        /// 罗马音标签存放路径
        /// </summary>
       /// <summary>
        /// 存放汉化tag的结构体
        /// </summary>
        internal static List<PixivHelper.TagStruct> TagStruct { get => tagStruct; set => tagStruct = value; }
        /// <summary>
        ///  罗马音tag读取后的列表
        /// </summary>
        internal static List<PublishHelper.TagHelper.RomeTagInfo> RomeTagList { get => romeTagList; set => romeTagList = value; }
        /// <summary>
        /// 罗马音tag放置路径
        /// </summary>
        public static string RomeTagPath { get => romeTagPaht; set => romeTagPaht = value; }
        /// <summary>
        /// 罗马音屏蔽词库路径
        /// </summary>
        public static string ExcludeRomeKeyPath { get => excludeRomeKeyPath; set => excludeRomeKeyPath = value; }
        /// <summary>
        /// 罗马音屏蔽词库list
        /// </summary>
        public static List<string> ExcludeRomeKey { get => excludeRomeKey; set => excludeRomeKey = value; }


    
    }
}
